-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Pagination: Correctly position the "next" link on the first page. #42764
Conversation
Size Change: +484 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR Ben!
I also have an exploratory PR for this: #40851.
@getdave good point on the RTL, I pushed a fix for that, using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this solves the main use case of this block for theme devs and we don't need to handle everything for now, so it's a big 🟢 for me. It's definitely way simpler than adding server side code with query calculations etc..
Good catch thanks @ntsekouras. I added a margin-inline-end: auto to the previous link so now it works like this: |
Thanks Ben! This seems to work well with the basic 'expected' scenarios:
If we change that order it might break some layouts.. I'll leave the decision to you as a theme dev and we can possibly keep an eye to it.. Another thing I was thinking is if we should restrict somehow Query Pagination to only allow these blocks and only once at most.. Do you think there are cases we need something more? A final thing would be unrelated to this PR about |
I think the block is already limited to only allow these blocks as inner blocks. |
You're right, yes! |
Good point, I've added a commit to restrict this CSS to only apply when the next/previous links are last/first elements. |
There is an open issue for restricting the number of times the inner blocks can be added: 42580 |
Oh, thanks for the ping here @ntsekouras — currently the logic that outputs the semantic classnames in |
What?
This is an alternative to #40553, and #36681 and fixes #34997.
The solution here only covers one case, which is:
In this scenario, the next page link is aligned to the left, which is not good UX:
How?
This PR just adds a
margin-inline-start: auto
to the next link in this scenario, so that it moves to the right, like so:This covers the main use case of this block.
Testing Instructions
@WordPress/block-themers